inherited fmAddCommon: TfmAddCommon
  Left = 447
  Top = 173
  Width = 1335
  Height = 828
  Caption = #1044#1086#1073#1072#1074#1080#1090#1100' '#1087#1083#1072#1090#1077#1078' '#1085#1072#1083#1080#1095#1085#1099#1084#1080
  Constraints.MinHeight = 700
  Constraints.MinWidth = 1203
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 774
    Width = 1327
  end
  inherited Panel1: TPanel
    Width = 1327
    TabOrder = 3
    inherited BitBtn1: TBitBtn
      Left = 1157
      Top = 9
    end
    inherited BitBtn2: TBitBtn
      Left = 1245
    end
  end
  object cxRadioGroup1: TcxRadioGroup [2]
    Left = 0
    Top = 267
    Align = alTop
    Properties.Columns = 4
    Properties.DefaultValue = 2
    Properties.Items = <
      item
        Caption = #1044#1086#1074#1077#1088'. '#1083#1080#1094#1072
        Value = 0
      end
      item
        Caption = #1042#1089#1077' '#1076#1086#1074#1077#1088'. '#1083#1080#1094#1072
        Value = 1
      end
      item
        Caption = #1042#1089#1077' '#1083#1102#1076#1080' '#1080#1079' '#1073#1072#1079#1099
        Value = 2
      end
      item
        Caption = #1070#1088'. '#1083#1080#1094#1072
        Value = 3
      end>
    Properties.ReadOnly = True
    Properties.OnChange = cxRadioGroup1PropertiesChange
    ItemIndex = 1
    TabOrder = 1
    Visible = False
    Height = 41
    Width = 1327
  end
  object rgCSForm: TcxDBRadioGroup [3]
    Left = 144
    Top = 692
    Caption = #1060#1086#1088#1084#1072' '#1086#1087#1083#1072#1090#1099
    DataBinding.DataField = 'CSFORM'
    DataBinding.DataSource = dlgDS
    Properties.Columns = 2
    Properties.DefaultValue = 0
    Properties.Items = <
      item
        Caption = #1053#1072#1083'.'
        Value = 0
      end
      item
        Caption = #1041#1077#1079#1085#1072#1083'.'
        Value = 1
      end>
    Properties.ReadOnly = True
    TabOrder = 0
    Visible = False
    Height = 41
    Width = 185
  end
  object dbgPeopleFind: TcxGrid [4]
    Left = 0
    Top = 308
    Width = 1327
    Height = 393
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 2
    LookAndFeel.Kind = lfStandard
    object tvAddCommon: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Enabled = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      DataController.DataSource = dsServDolg
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'BALANCE'
          Column = tvAddCommonBALANCE
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'ZAPL'
          Column = tvAddCommonZAPL
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'BEZNAL'
          Column = tvAddCommonBEZNAL
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'NAL'
          Column = tvAddCommonNAL
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'UJE_ZAPLATILI'
          Column = tvAddCommonUJE_ZAPLATILI
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'DOLGNY_ZAPL'
          Column = tvAddCommonSCAMOUNT
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.FocusFirstCellOnNewRecord = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.Appending = True
      OptionsData.Deleting = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 5
      OptionsView.CellAutoHeight = True
      OptionsView.CellTextMaxLineCount = 2
      OptionsView.ColumnAutoWidth = True
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.HeaderEndEllipsis = True
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxGreenText
      Styles.Header = DMInv.cxSiniyText
      object tvAddCommonSCNUM_N: TcxGridDBColumn
        Caption = #8470' '#1089#1082#1074#1079#1085
        DataBinding.FieldName = 'SCID'
        Options.Editing = False
      end
      object tvAddCommonSTNAME: TcxGridDBColumn
        Caption = #1059#1089#1083#1091#1075#1072
        DataBinding.FieldName = 'STNAME'
        Options.Editing = False
        Width = 330
      end
      object tvAddCommonSCDATEBEGIN: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1074#1089#1090'. '#1074' '#1089#1080#1083#1091
        DataBinding.FieldName = 'SCDATEBEGIN'
        Options.Editing = False
      end
      object tvAddCommonSCDATEEND: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1086#1082#1086#1085#1095'.'
        DataBinding.FieldName = 'SCDATEEND'
        Options.Editing = False
      end
      object tvAddCommonSTTARIF: TcxGridDBColumn
        Caption = #1058#1072#1088#1080#1092
        DataBinding.FieldName = 'STTARIF'
        Options.Editing = False
      end
      object tvAddCommonSKIDKA: TcxGridDBColumn
        Caption = #1057#1082#1080#1076#1082#1072
        DataBinding.FieldName = 'SKIDKA'
        Options.Editing = False
      end
      object tvAddCommonTIP: TcxGridDBColumn
        Caption = #1058#1080#1087
        DataBinding.FieldName = 'TIP'
        Options.Editing = False
      end
      object tvAddCommonPERIOD: TcxGridDBColumn
        Caption = #1055#1077#1088#1080#1086#1076
        DataBinding.FieldName = 'PERIOD'
        Options.Editing = False
      end
      object tvAddCommonSCAMOUNT: TcxGridDBColumn
        Caption = #1055#1088#1086#1076#1072#1085#1086' '#1087#1086' '#1075#1088#1072#1092#1080#1082#1091
        DataBinding.FieldName = 'DOLGNY_ZAPL'
        Options.Editing = False
        Width = 125
      end
      object tvAddCommonNAL: TcxGridDBColumn
        Caption = #1054#1087#1083#1072#1095#1077#1085#1086' '#1053#1072#1083'.'
        DataBinding.FieldName = 'NAL'
        Options.Editing = False
        Width = 111
      end
      object tvAddCommonBEZNAL: TcxGridDBColumn
        Caption = #1054#1087#1083#1072#1095#1077#1085#1086' '#1041#1077#1079#1085#1072#1083'.'
        DataBinding.FieldName = 'BEZNAL'
        Options.Editing = False
        Width = 111
      end
      object tvAddCommonUJE_ZAPLATILI: TcxGridDBColumn
        Caption = #1042#1089#1077#1075#1086' '#1054#1087#1083#1072#1095#1077#1085#1086
        DataBinding.FieldName = 'UJE_ZAPLATILI'
        Options.Editing = False
        Width = 104
      end
      object tvAddCommonBALANCE: TcxGridDBColumn
        Caption = #1047#1072#1076#1086#1083#1078#1077#1085#1085#1086#1089#1090#1100
        DataBinding.FieldName = 'BALANCE1'
        Options.Editing = False
        Options.Sorting = False
        Width = 100
      end
      object tvAddCommonZAPL: TcxGridDBColumn
        Caption = #1042#1085#1077#1089#1090#1080
        DataBinding.FieldName = 'ZAPL'
        PropertiesClassName = 'TcxCalcEditProperties'
        Properties.OnEditValueChanged = tvPeopleFindZAPLPropertiesEditValueChanged
        Options.Sorting = False
        Styles.Content = DMInv.cxJoltiyFon
        Width = 88
      end
    end
    object dbgPeopleFindLevel1: TcxGridLevel
      GridView = tvAddCommon
    end
  end
  object Panel4: TPanel [5]
    Left = 0
    Top = 45
    Width = 1327
    Height = 196
    Align = alTop
    TabOrder = 5
    object Label18: TLabel
      Left = 8
      Top = 130
      Width = 58
      Height = 13
      Caption = #1050#1090#1086' '#1087#1083#1072#1090#1080#1090
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label1: TLabel
      Left = 176
      Top = 76
      Width = 60
      Height = 13
      Caption = #1057#1091#1084#1084#1072', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label2: TLabel
      Left = 8
      Top = 76
      Width = 67
      Height = 13
      Caption = #1044#1072#1090#1072' '#1086#1087#1083#1072#1090#1099
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label11: TLabel
      Left = 336
      Top = 76
      Width = 133
      Height = 13
      Caption = #1041#1072#1085#1082#1086#1074#1089#1082#1080#1081' '#1087#1088#1086#1094#1077#1085#1090', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label12: TLabel
      Left = 904
      Top = 132
      Width = 76
      Height = 13
      Caption = #1044#1077#1085#1100#1075#1080' '#1087#1088#1080#1085#1103#1083
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label13: TLabel
      Left = 480
      Top = 75
      Width = 127
      Height = 13
      Caption = #1044#1086#1083#1075' '#1087#1086' '#1073#1072#1085#1082'. '#1087#1088#1086#1094'., '#1088#1091#1073
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      Visible = False
    end
    object cxDBDateEdit1: TcxDBDateEdit
      Left = 8
      Top = 93
      DataBinding.DataField = 'CSDATE'
      DataBinding.DataSource = dlgDS
      ParentFont = False
      Properties.DateButtons = [btnClear, btnToday]
      Properties.InputKind = ikMask
      Properties.ReadOnly = True
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 0
      Width = 153
    end
    object edCSAMOUNT: TcxDBTextEdit
      Left = 178
      Top = 93
      DataBinding.DataField = 'CSAMOUNT'
      DataBinding.DataSource = dlgDS
      ParentFont = False
      Properties.IncrementalSearch = False
      Properties.OnEditValueChanged = edCSAMOUNTPropertiesEditValueChanged
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 1
      Width = 143
    end
    object GroupBox1: TGroupBox
      Left = 7
      Top = 5
      Width = 882
      Height = 66
      Caption = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1091#1089#1083#1091#1075
      TabOrder = 2
      object Label5: TLabel
        Left = 8
        Top = 14
        Width = 23
        Height = 13
        Caption = #1060#1048#1054
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
      end
      object Label6: TLabel
        Left = 488
        Top = 14
        Width = 80
        Height = 13
        Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
      end
      object Label7: TLabel
        Left = 608
        Top = 14
        Width = 19
        Height = 13
        Caption = #1051#1077#1090
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
      end
      object Label8: TLabel
        Left = 648
        Top = 14
        Width = 19
        Height = 13
        Caption = #1052#1077#1089
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
      end
      object Label9: TLabel
        Left = 688
        Top = 14
        Width = 173
        Height = 13
        Caption = #1054#1073#1088#1072#1079#1086#1074#1072#1090#1077#1083#1100#1085#1086#1077' '#1087#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1077
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
      end
      object cxDBTextEdit1: TcxDBTextEdit
        Left = 8
        Top = 29
        TabStop = False
        DataBinding.DataField = 'PP'
        DataBinding.DataSource = dsPoluchUslug
        ParentFont = False
        Properties.ReadOnly = True
        Style.Color = clMoneyGreen
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clWindowText
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = [fsBold]
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 0
        Width = 473
      end
      object cxDBTextEdit2: TcxDBTextEdit
        Left = 488
        Top = 29
        TabStop = False
        DataBinding.DataField = 'PDATEBIRTH'
        DataBinding.DataSource = dsPoluchUslug
        ParentFont = False
        Properties.ReadOnly = True
        Style.Color = clMoneyGreen
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clWindowText
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = [fsBold]
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 1
        Width = 113
      end
      object cxDBTextEdit3: TcxDBTextEdit
        Left = 608
        Top = 29
        TabStop = False
        DataBinding.DataField = 'LET'
        DataBinding.DataSource = dsPoluchUslug
        ParentFont = False
        Properties.ReadOnly = True
        Style.Color = clMoneyGreen
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clWindowText
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = [fsBold]
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 2
        Width = 33
      end
      object cxDBTextEdit4: TcxDBTextEdit
        Left = 647
        Top = 29
        TabStop = False
        DataBinding.DataField = 'MES'
        DataBinding.DataSource = dsPoluchUslug
        ParentFont = False
        Properties.ReadOnly = True
        Style.Color = clMoneyGreen
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clWindowText
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = [fsBold]
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 3
        Width = 33
      end
      object cxDBTextEdit5: TcxDBTextEdit
        Left = 688
        Top = 29
        TabStop = False
        DataBinding.DataField = 'OSN_PODR'
        DataBinding.DataSource = dsPoluchUslug
        ParentFont = False
        Properties.ReadOnly = True
        Style.Color = clMoneyGreen
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clWindowText
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = [fsBold]
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 4
        Width = 185
      end
    end
    object Panel2: TPanel
      Left = 6
      Top = 147
      Width = 881
      Height = 41
      Caption = 'Panel2'
      TabOrder = 3
      DesignSize = (
        881
        41)
      object lcbPayer: TcxDBLookupComboBox
        Left = 5
        Top = 6
        DataBinding.DataField = 'PID'
        DataBinding.DataSource = dsPC
        ParentFont = False
        Properties.DropDownListStyle = lsEditList
        Properties.DropDownRows = 15
        Properties.KeyFieldNames = 'PID'
        Properties.ListColumns = <
          item
            Caption = #1060#1048#1054
            FieldName = 'PP'
          end
          item
            Caption = #1057#1090#1072#1090#1091#1089
            FieldName = 'SDNAME'
          end
          item
            Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076'.'
            Fixed = True
            FieldName = 'PDATEBIRTH'
          end>
        Properties.ListSource = dsPeople
        Properties.MaxLength = 0
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clBlack
        Style.Font.Height = -15
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 0
        OnClick = lcbPayerClick
        Width = 802
      end
      object bReload: TcxButton
        Tag = 12
        Left = 814
        Top = 6
        Width = 30
        Height = 29
        Hint = #1054#1073#1085#1086#1074#1080#1090#1100' '#1076#1072#1085#1085#1099#1077
        Anchors = [akTop, akRight]
        ParentShowHint = False
        ShowHint = True
        TabOrder = 1
        TabStop = False
        OnClick = bReloadClick
        Glyph.Data = {
          DE010000424DDE01000000000000760000002800000024000000120000000100
          0400000000006801000000000000000000001000000000000000000000000000
          8000008000000080800080000000800080008080000080808000C0C0C0000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333444444
          33333333333F7777773F33330000324334222222443333377F3733333377F333
          000032244222222222433337F7733FFFFF337F3300003222222AAAAA22243337
          F333F77777F337F30000322222A33333A2224337F33F7333337F337F00003222
          223333333A224337F33733333337F37F00003222222333333A444337FFFF7F33
          3337777300003AAAAAAA33333333333777777733333333330000333333333333
          333333333333333333FFFFFF000033333333333344444433FFFF333333777777
          00003A444333333A22222437777F333337F3333700003A2243333333A2222437
          F37F333333733337000033A224333334422224337337FFFFF7733337000033A2
          22444442222224337F3377777333FF370000333A2222222222AA243337FF3333
          33FF77F700003333AA222222AA33A3333377FFFFFF7733730000333333AAAAAA
          3333333333337777773333330000333333333333333333333333333333333333
          0000}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
      object bAddMan: TcxButton
        Tag = 12
        Left = 849
        Top = 6
        Width = 30
        Height = 29
        Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1095#1077#1083#1086#1074#1077#1082#1072
        Anchors = [akTop, akRight]
        ParentShowHint = False
        ShowHint = True
        TabOrder = 2
        TabStop = False
        OnClick = bAddManClick
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          04000000000000010000CE0E0000D80E00001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
          3333333333387F3333333333333333333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333387FFFFFFFFFFFFF3344444444444433387777777F777777334444444444
          4433388888887F8888883333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F33333333333334433333333333333877333333333333333333
          3333333333388833333333333333333333333333333333333333}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
    end
    object Panel3: TPanel
      Left = 158
      Top = 211
      Width = 882
      Height = 38
      Caption = 'Panel3'
      TabOrder = 4
      Visible = False
      DesignSize = (
        882
        38)
      object lcbJL: TcxDBLookupComboBox
        Left = 3
        Top = 5
        DataBinding.DataField = 'JLID'
        DataBinding.DataSource = dlgDS
        ParentFont = False
        Properties.DropDownListStyle = lsEditList
        Properties.DropDownRows = 15
        Properties.KeyFieldNames = 'JLID'
        Properties.ListColumns = <
          item
            Caption = #1054#1055#1060
            MinWidth = 5
            FieldName = 'JLOPF'
          end
          item
            Caption = #1053#1072#1079#1074#1072#1085#1080#1077
            FieldName = 'JLEGALNAME'
          end
          item
            Caption = #1054#1043#1056#1053
            Fixed = True
            FieldName = 'JLOGRN'
          end
          item
            Caption = #1048#1053#1053
            FieldName = 'JLINN'
          end>
        Properties.ListSource = dsJL
        Properties.MaxLength = 0
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clBlack
        Style.Font.Height = -15
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 0
        Width = 802
      end
      object bAddJL: TcxButton
        Tag = 12
        Left = 804
        Top = 4
        Width = 75
        Height = 29
        Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1095#1077#1083#1086#1074#1077#1082#1072
        Anchors = [akTop, akRight]
        Caption = #1070#1088'. '#1083#1080#1094#1086
        ParentShowHint = False
        ShowHint = True
        TabOrder = 1
        TabStop = False
        Visible = False
        OnClick = bAddJLClick
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          04000000000000010000CE0E0000D80E00001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
          3333333333387F3333333333333333333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333387FFFFFFFFFFFFF3344444444444433387777777F777777334444444444
          4433388888887F8888883333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F33333333333334433333333333333877333333333333333333
          3333333333388833333333333333333333333333333333333333}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
    end
    object eProc: TcxTextEdit
      Left = 337
      Top = 93
      TabStop = False
      ParentFont = False
      Properties.ReadOnly = True
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 5
      Width = 121
    end
    object cxDBLookupComboBox1: TcxDBLookupComboBox
      Left = 904
      Top = 151
      DataBinding.DataField = 'CSUSERMONEY'
      DataBinding.DataSource = dlgDS
      ParentFont = False
      Properties.DropDownListStyle = lsEditList
      Properties.DropDownRows = 15
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'PP'
        end>
      Properties.ListSource = dsPeopleMoney
      Properties.MaxLength = 0
      Properties.OnChange = cxDBLookupComboBox1PropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clBlack
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 6
      OnClick = cxDBLookupComboBox1Click
      Width = 284
    end
    object cxDBTextEdit6: TcxDBTextEdit
      Left = 480
      Top = 93
      TabStop = False
      DataBinding.DataField = 'BALANCE'
      DataBinding.DataSource = dsDolgBankPerc
      ParentFont = False
      Properties.ReadOnly = True
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 7
      Visible = False
      Width = 121
    end
    object cbAcademPlat: TcxCheckBox
      Left = 632
      Top = 96
      Caption = #1055#1083#1072#1090#1077#1078' '#1086#1090' '#1040#1082#1072#1076#1077#1084#1080#1095#1077#1089#1082#1086#1081' '#1075#1080#1084#1085#1072#1079#1080#1080
      Properties.OnChange = cbAcademPlatPropertiesChange
      TabOrder = 8
      Visible = False
      Width = 217
    end
    object lPlat: TcxLabel
      Left = 24
      Top = 152
      Caption = #1053#1054#1059' '#1057#1054#1064' "'#1040#1082#1072#1076#1077#1084#1080#1095#1077#1089#1082#1072#1103' '#1075#1080#1084#1085#1072#1079#1080#1103'"'
      ParentFont = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.IsFontAssigned = True
      Visible = False
    end
  end
  object ToolBar1: TToolBar [6]
    Left = 0
    Top = 241
    Width = 1327
    Height = 26
    AutoSize = True
    ButtonWidth = 33
    Caption = 'ToolBar1'
    Images = DMInv.ilActive
    TabOrder = 6
    Transparent = False
    Wrapable = False
    object tbColumn: TToolButton
      Left = 0
      Top = 2
      Hint = #1050#1086#1083#1086#1085#1082#1080' '#1090#1072#1073#1083#1080#1094#1099
      AutoSize = True
      Caption = 'tbColumn'
      ImageIndex = 34
      ParentShowHint = False
      ShowHint = True
      OnClick = tbColumnClick
    end
    object ToolButton1: TToolButton
      Left = 23
      Top = 2
      Width = 8
      Caption = 'ToolButton1'
      ImageIndex = 35
      Style = tbsSeparator
    end
    object cbShowAllCS: TcxCheckBox
      Left = 31
      Top = 2
      Align = alLeft
      Caption = #1055#1086#1082#1072#1079#1072#1090#1100' '#1074#1089#1077' '#1091#1089#1083#1091#1075#1080
      Properties.OnChange = cbShowAllCSPropertiesChange
      TabOrder = 0
      Width = 138
    end
  end
  object Panel5: TPanel [7]
    Left = 0
    Top = 701
    Width = 1327
    Height = 73
    Align = alBottom
    TabOrder = 7
    DesignSize = (
      1327
      73)
    object Label4: TLabel
      Left = 8
      Top = 4
      Width = 152
      Height = 13
      Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081' '#1082' '#1092#1072#1082#1090#1091' '#1086#1087#1083#1072#1090#1099
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label10: TLabel
      Left = 1066
      Top = 4
      Width = 134
      Height = 13
      Anchors = [akTop, akRight]
      Caption = #1054#1089#1090#1072#1090#1086#1082' '#1086#1090' '#1087#1083#1072#1090#1077#1078#1072', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxDBMemo2: TcxDBMemo
      Left = 7
      Top = 26
      DataBinding.DataField = 'CSNOTE'
      DataBinding.DataSource = dlgDS
      ParentFont = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.TextStyle = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 0
      Height = 31
      Width = 882
    end
    object bResetRaznesenie: TcxButton
      Left = 1208
      Top = 40
      Width = 111
      Height = 25
      Anchors = [akTop, akRight]
      Caption = #1057#1073#1088#1086#1089' '#1088#1072#1079#1085#1077#1089#1077#1085#1080#1103
      TabOrder = 1
      OnClick = bResetRaznesenieClick
    end
    object eOstatok: TcxTextEdit
      Left = 1207
      Top = 6
      TabStop = False
      Anchors = [akTop, akRight]
      ParentFont = False
      Properties.ReadOnly = True
      Properties.OnChange = cxTextEdit1PropertiesChange
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.TextStyle = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 2
      Width = 112
    end
  end
  object qUserGenSelect: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT U.BUHGENERATOR'
      'FROM USERS U'
      'WHERE U.PID = :gUserID')
    GeneratorField.Field = 'CSID'
    Left = 632
    Top = 8
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'gUserID'
        ParamType = ptUnknown
      end>
    object qUserGenSelectBUHGENERATOR: TIntegerField
      FieldName = 'BUHGENERATOR'
      Origin = '"USERS"."BUHGENERATOR"'
    end
  end
  object qUserGenSet: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'UPDATE USERS SET BUHGENERATOR = :BUHGENERATOR'
      'WHERE USERS.PID= :gUserID')
    GeneratorField.Field = 'CSID'
    Left = 680
    Top = 8
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'BUHGENERATOR'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'gUserID'
        ParamType = ptUnknown
      end>
  end
  object qJL: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT J.*'
      'FROM JURLITSA J')
    Left = 752
    Top = 200
    object qJLJLID: TIntegerField
      FieldName = 'JLID'
      Origin = '"JURLITSA"."JLID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qJLJLEGALNAME: TIBStringField
      DisplayWidth = 15
      FieldName = 'JLEGALNAME'
      Origin = '"JURLITSA"."JLEGALNAME"'
      Size = 255
    end
    object qJLJLNOTE: TIBStringField
      FieldName = 'JLNOTE'
      Origin = '"JURLITSA"."JLNOTE"'
      Size = 255
    end
    object qJLJLUSERENTER: TIBStringField
      FieldName = 'JLUSERENTER'
      Origin = '"JURLITSA"."JLUSERENTER"'
      Size = 40
    end
    object qJLJLTIMEENTER: TDateTimeField
      FieldName = 'JLTIMEENTER'
      Origin = '"JURLITSA"."JLTIMEENTER"'
    end
    object qJLJLUSEREDIT: TIBStringField
      FieldName = 'JLUSEREDIT'
      Origin = '"JURLITSA"."JLUSEREDIT"'
      Size = 40
    end
    object qJLJLTIMEEDIT: TDateTimeField
      FieldName = 'JLTIMEEDIT'
      Origin = '"JURLITSA"."JLTIMEEDIT"'
    end
    object qJLJLINN: TIBStringField
      DisplayWidth = 12
      FieldName = 'JLINN'
      Origin = '"JURLITSA"."JLINN"'
      Size = 12
    end
    object qJLJLOGRN: TIBStringField
      DisplayWidth = 12
      FieldName = 'JLOGRN'
      Origin = '"JURLITSA"."JLOGRN"'
      Size = 255
    end
    object qJLJLOPF: TIBStringField
      DisplayWidth = 5
      FieldName = 'JLOPF'
      Origin = '"JURLITSA"."JLOPF"'
      Size = 10
    end
    object qJLJLLEGALADRESS: TIBStringField
      DisplayWidth = 15
      FieldName = 'JLLEGALADRESS'
      Origin = '"JURLITSA"."JLLEGALADRESS"'
      Size = 255
    end
    object qJLJLCEONAME: TIBStringField
      FieldName = 'JLCEONAME'
      Origin = '"JURLITSA"."JLCEONAME"'
      Size = 255
    end
  end
  object dsJL: TDataSource
    DataSet = qJL
    Left = 720
    Top = 192
  end
  object qServDolg: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    BeforePost = qServDolgBeforePost
    CachedUpdates = True
    DataSource = dsPoluchUslug
    SQL.Strings = (
      'SELECT ST.STNAME, S.SID, SC.SCID,'
      '       SC.SCNUM_N, SC.SCDATEBEGIN, SC.SCDATEEND,'
      
        '       SC.SCTARIFWITHDISCOUNT, ST.STTARIF, (ST.STTARIF - SC.SCTA' +
        'RIFWITHDISCOUNT) AS skidka,'
      '       CASE ST.STTYPE'
      '       WHEN 0 THEN '#39#1056#1072#1079#1086#1074#1072#1103#39
      '       WHEN 1 THEN '#39#1054#1089#1085#1086#1074#1085'.'#39
      '       WHEN 2 THEN '#39#1044#1086#1087#1086#1083#1085#1080#1090'.'#39
      '       END AS tip,'
      '       IIF (ST.STTYPE <> 0,'
      '       CASE ST.STPERIODOPLATY'
      '       WHEN 0 THEN '#39#1052#1077#1089#1103#1094#39
      '       WHEN 1 THEN '#39#1050#1074#1072#1088#1090#1072#1083#39
      '       END, '#39#1053#1077#1090#39') AS period,'
      
        '       CAST(COALESCE(SCPD.dolgny_zapl, 0) AS NUMERIC(18,0)) AS d' +
        'olgny_zapl,'
      
        'CAST ((COALESCE(SCPD.dolgny_zapl, 0) - COALESCE(SCPD1.zapl1,0) -' +
        ' COALESCE(SCPD2.zapl1,0)) AS NUMERIC(18,0))  AS balance,'
      
        'CAST ((COALESCE(SCPD.dolgny_zapl, 0) - COALESCE(SCPD1.zapl1,0) -' +
        ' COALESCE(SCPD2.zapl1,0)) AS NUMERIC(18,0)) AS balance1,'
      
        'CAST('#39'0'#39' AS INTEGER) AS zapl, COALESCE(SCPD1.zapl1,0) AS nal, CO' +
        'ALESCE(SCPD2.zapl1,0) AS beznal,'
      
        '(COALESCE(SCPD1.zapl1,0) + COALESCE(SCPD2.zapl1,0)) AS uje_zapla' +
        'tili'
      'FROM SPEC_COND SC'
      'LEFT OUTER JOIN'
      '('
      'SELECT GP.SCID, SUM(GP.GPAMOUNT) AS dolgny_zapl'
      'FROM SC_GRAFPLAT GP'
      'WHERE GP.GPDATE <= CURRENT_DATE'
      'GROUP BY 1) AS SCPD ON SCPD.SCID = SC.SCID'
      'LEFT OUTER JOIN'
      '('
      'SELECT COM.SCID, SUM(COM.CAMOUNT) AS zapl1'
      'FROM COMMON_SERV CS'
      'INNER JOIN COMMON COM ON COM.CSID = CS.CSID'
      'INNER JOIN SPEC_COND SC ON SC.SCID = COM.SCID '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      
        'WHERE CS.CSISDELETE IS NULL AND SC.SCISDELETE IS NULL AND A.AGIS' +
        'DELETE IS NULL '
      '    AND CS.PID_POLUCH = :PID'
      '    AND CS.CSFORM = 0'
      '    AND COM.CTYPE < 2'
      'GROUP BY 1'
      ') AS SCPD1 ON SCPD1.SCID = SC.SCID'
      'LEFT OUTER JOIN'
      '('
      'SELECT COM.SCID, SUM(COM.CAMOUNT) AS zapl1'
      'FROM COMMON_SERV CS'
      'INNER JOIN COMMON COM ON COM.CSID = CS.CSID'
      'INNER JOIN SPEC_COND SC ON SC.SCID = COM.SCID '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      
        'WHERE CS.CSISDELETE IS NULL AND SC.SCISDELETE IS NULL AND A.AGIS' +
        'DELETE IS NULL '
      '    AND CS.PID_POLUCH = :PID'
      '    AND CS.CSFORM = 1'
      '    AND COM.CTYPE < 2'
      'GROUP BY 1'
      ') AS SCPD2 ON SCPD2.SCID = SC.SCID'
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID'
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID'
      'INNER JOIN SERVICES S ON S.SCID = SC.SCID'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'WHERE SC.SCISDELETE IS NULL'
      '    AND APU.PID = :PID'
      '    AND A.AGISDELETE IS NULL'
      'UNION'
      
        'SELECT FIRST 1 '#39' '#1055#1083#1072#1090#1072' '#1079#1072' '#1087#1077#1088#1077#1095#1080#1089#1083#1077#1085#1080#1077' '#1076#1077#1085#1077#1075' '#1085#1072' '#1088'/'#1089' '#1086#1073#1088#1072#1079#1086#1074#1072#1090#1077#1083#1100 +
        #1085#1086#1075#1086' '#1091#1095#1088#1077#1078#1076#1077#1085#1080#1103' '#1095#1077#1088#1077#1079' '#1073#1072#1085#1082#39' AS STNAME,'
      'CAST('#39'-1'#39' AS INTEGER) AS SID, SC1.SCID,'
      
        '       CAST('#39'0'#39' AS NUMERIC(18,0)) AS SCNUM_N, CURRENT_DATE, CURR' +
        'ENT_DATE,'
      
        '       CAST('#39'0'#39' AS NUMERIC(18,0)) AS SCTARIFWITHDISCOUNT, CAST('#39 +
        '0'#39' AS NUMERIC(18,0)) AS STTARIF, CAST('#39'0'#39' AS NUMERIC(18,0)) AS s' +
        'kidka,'
      '       '#39#1056#1072#1079#1086#1074#1072#1103#39' AS tip,'
      '       '#39#1053#1077#1090#39' AS period,'
      'CAST('#39'0'#39' AS NUMERIC(18,0)) AS dolgny_zapl,'
      
        'SC1.SCBALANCE AS balance, CAST('#39'0'#39' AS NUMERIC(18,0)) AS balance1' +
        ', CAST('#39'0'#39' AS INTEGER) AS zapl,'
      
        'CAST('#39'0'#39' AS NUMERIC(18,0)) AS nal, CAST('#39'0'#39' AS NUMERIC(18,0)) AS' +
        ' beznal,'
      'CAST('#39'0'#39' AS NUMERIC(18,0)) AS uje_zaplatili'
      'FROM SPEC_COND SC1'
      'ORDER BY 1'
      ''
      '')
    UpdateObject = quServDolg
    Left = 680
    Top = 184
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qServDolgSTNAME: TIBStringField
      FieldName = 'STNAME'
      Origin = '"SERVICES_TYPE"."STNAME"'
      Size = 255
    end
    object qServDolgSID: TIntegerField
      FieldName = 'SID'
      Origin = '"SERVICES"."SID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qServDolgSCID: TIntegerField
      FieldName = 'SCID'
      Origin = '"SPEC_COND"."SCID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qServDolgSCDATEEND: TDateField
      FieldName = 'SCDATEEND'
      Origin = '"SPEC_COND"."SCDATEEND"'
    end
    object qServDolgSCDATEBEGIN: TDateField
      FieldName = 'SCDATEBEGIN'
      Origin = '"SPEC_COND"."SCDATEBEGIN"'
    end
    object qServDolgSCTARIFWITHDISCOUNT: TIBBCDField
      FieldName = 'SCTARIFWITHDISCOUNT'
      Origin = '"SPEC_COND"."SCTARIFWITHDISCOUNT"'
      Precision = 18
      Size = 2
    end
    object qServDolgZAPL: TIntegerField
      FieldName = 'ZAPL'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      EditFormat = '0'
    end
    object qServDolgBALANCE: TIBBCDField
      FieldName = 'BALANCE'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qServDolgBALANCE1: TLargeintField
      FieldName = 'BALANCE1'
      ProviderFlags = []
      DisplayFormat = '#,###0'
    end
    object qServDolgDOLGNY_ZAPL: TLargeintField
      FieldName = 'DOLGNY_ZAPL'
      ProviderFlags = []
      DisplayFormat = '#,###0'
    end
    object qServDolgNAL: TIBBCDField
      FieldName = 'NAL'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qServDolgBEZNAL: TIBBCDField
      FieldName = 'BEZNAL'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qServDolgUJE_ZAPLATILI: TIBBCDField
      FieldName = 'UJE_ZAPLATILI'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qServDolgSTTARIF: TIBBCDField
      FieldName = 'STTARIF'
      Origin = '"SERVICES_TYPE"."STTARIF"'
      Required = True
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qServDolgSKIDKA: TIBBCDField
      FieldName = 'SKIDKA'
      ProviderFlags = []
      Precision = 18
      Size = 2
    end
    object qServDolgTIP: TIBStringField
      FieldName = 'TIP'
      ProviderFlags = []
      FixedChar = True
      Size = 9
    end
    object qServDolgPERIOD: TIBStringField
      FieldName = 'PERIOD'
      ProviderFlags = []
      FixedChar = True
      Size = 7
    end
    object qServDolgSCNUM_N: TLargeintField
      FieldName = 'SCNUM_N'
      ProviderFlags = []
    end
  end
  object dsServDolg: TDataSource
    DataSet = qServDolg
    Left = 648
    Top = 184
  end
  object quServDolg: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  STNAME,'
      '  SCID,'
      '  SCNUM_N,'
      '  AGID,'
      '  SCNUMBER,'
      '  SCDATE,'
      '  SCDATEEND,'
      '  SCNOTE,'
      '  SCISDELETE,'
      '  SCISNEEDRESIGN,'
      '  SCUSERENTER,'
      '  SCTIMEENTER,'
      '  SCUSEREDIT,'
      '  SCTIMEEDIT,'
      '  SCDATEREGISTER,'
      '  SCUSERREGISTER,'
      '  SCDISCOUNT,'
      '  SCTYPEOFDISCOUNT,'
      '  SCDISCOUNTNOTE,'
      '  SCDISCOUNTAUTORISATION,'
      '  SCMINPERIOD,'
      '  SCTYPEOFDISC,'
      '  SCDATEBEGIN,'
      '  SCTARIF,'
      '  SCTARIFWITHDISCOUNT,'
      '  SCAMOUNT,'
      '  SCBALANCE,'
      '  BALANCE,'
      '  ZAPL'
      'from SPEC_COND '
      'where'
      '  AGID = :AGID')
    ModifySQL.Strings = (
      'update SPEC_COND'
      'set'
      '  AGID = :AGID,'
      '  BALANCE = :BALANCE,'
      '  SCAMOUNT = :SCAMOUNT,'
      '  SCBALANCE = :SCBALANCE,'
      '  SCDATE = :SCDATE,'
      '  SCDATEBEGIN = :SCDATEBEGIN,'
      '  SCDATEEND = :SCDATEEND,'
      '  SCDATEREGISTER = :SCDATEREGISTER,'
      '  SCDISCOUNT = :SCDISCOUNT,'
      '  SCDISCOUNTAUTORISATION = :SCDISCOUNTAUTORISATION,'
      '  SCDISCOUNTNOTE = :SCDISCOUNTNOTE,'
      '  SCID = :SCID,'
      '  SCISDELETE = :SCISDELETE,'
      '  SCISNEEDRESIGN = :SCISNEEDRESIGN,'
      '  SCMINPERIOD = :SCMINPERIOD,'
      '  SCNOTE = :SCNOTE,'
      '  SCNUM_N = :SCNUM_N,'
      '  SCNUMBER = :SCNUMBER,'
      '  SCTARIF = :SCTARIF,'
      '  SCTARIFWITHDISCOUNT = :SCTARIFWITHDISCOUNT,'
      '  SCTIMEEDIT = :SCTIMEEDIT,'
      '  SCTIMEENTER = :SCTIMEENTER,'
      '  SCTYPEOFDISC = :SCTYPEOFDISC,'
      '  SCTYPEOFDISCOUNT = :SCTYPEOFDISCOUNT,'
      '  SCUSEREDIT = :SCUSEREDIT,'
      '  SCUSERENTER = :SCUSERENTER,'
      '  SCUSERREGISTER = :SCUSERREGISTER,'
      '  STNAME = :STNAME,'
      '  ZAPL = :ZAPL'
      'where'
      '  AGID = :OLD_AGID')
    InsertSQL.Strings = (
      'insert into SPEC_COND'
      
        '  (AGID, BALANCE, SCAMOUNT, SCBALANCE, SCDATE, SCDATEBEGIN, SCDA' +
        'TEEND, '
      
        '   SCDATEREGISTER, SCDISCOUNT, SCDISCOUNTAUTORISATION, SCDISCOUN' +
        'TNOTE, '
      
        '   SCID, SCISDELETE, SCISNEEDRESIGN, SCMINPERIOD, SCNOTE, SCNUM_' +
        'N, SCNUMBER, '
      
        '   SCTARIF, SCTARIFWITHDISCOUNT, SCTIMEEDIT, SCTIMEENTER, SCTYPE' +
        'OFDISC, '
      
        '   SCTYPEOFDISCOUNT, SCUSEREDIT, SCUSERENTER, SCUSERREGISTER, ST' +
        'NAME, ZAPL)'
      'values'
      
        '  (:AGID, :BALANCE, :SCAMOUNT, :SCBALANCE, :SCDATE, :SCDATEBEGIN' +
        ', :SCDATEEND, '
      
        '   :SCDATEREGISTER, :SCDISCOUNT, :SCDISCOUNTAUTORISATION, :SCDIS' +
        'COUNTNOTE, '
      
        '   :SCID, :SCISDELETE, :SCISNEEDRESIGN, :SCMINPERIOD, :SCNOTE, :' +
        'SCNUM_N, '
      
        '   :SCNUMBER, :SCTARIF, :SCTARIFWITHDISCOUNT, :SCTIMEEDIT, :SCTI' +
        'MEENTER, '
      
        '   :SCTYPEOFDISC, :SCTYPEOFDISCOUNT, :SCUSEREDIT, :SCUSERENTER, ' +
        ':SCUSERREGISTER, '
      '   :STNAME, :ZAPL)')
    DeleteSQL.Strings = (
      'null;')
    Left = 712
    Top = 181
  end
  object qCommons: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qCommonsAfterInsert
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT *'
      'FROM COMMON C'
      'WHERE C.CSID = :CSID')
    UpdateObject = quCommons
    GeneratorField.Field = 'CID'
    GeneratorField.Generator = 'GEN_COMMON_ID'
    Left = 936
    Top = 312
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'CSID'
        ParamType = ptUnknown
      end>
    object qCommonsCID: TIntegerField
      FieldName = 'CID'
      Origin = '"COMMON"."CID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qCommonsCSID: TIntegerField
      FieldName = 'CSID'
      Origin = '"COMMON"."CSID"'
    end
    object qCommonsCTYPE: TIntegerField
      FieldName = 'CTYPE'
      Origin = '"COMMON"."CTYPE"'
    end
    object qCommonsCAMOUNT: TIBBCDField
      FieldName = 'CAMOUNT'
      Origin = '"COMMON"."CAMOUNT"'
      Precision = 18
      Size = 2
    end
    object qCommonsCID_CORRECT: TIntegerField
      FieldName = 'CID_CORRECT'
      Origin = '"COMMON"."CID_CORRECT"'
    end
    object qCommonsCDATE: TDateField
      FieldName = 'CDATE'
      Origin = '"COMMON"."CDATE"'
    end
    object qCommonsCUSERENTER: TIBStringField
      FieldName = 'CUSERENTER'
      Origin = '"COMMON"."CUSERENTER"'
      Size = 40
    end
    object qCommonsCTIMEENTER: TDateTimeField
      FieldName = 'CTIMEENTER'
      Origin = '"COMMON"."CTIMEENTER"'
    end
    object qCommonsCUSEREDIT: TIBStringField
      FieldName = 'CUSEREDIT'
      Origin = '"COMMON"."CUSEREDIT"'
      Size = 40
    end
    object qCommonsCTIMEEDIT: TDateTimeField
      FieldName = 'CTIMEEDIT'
      Origin = '"COMMON"."CTIMEEDIT"'
    end
    object qCommonsSCID: TIntegerField
      FieldName = 'SCID'
      Origin = '"COMMON"."SCID"'
    end
  end
  object quCommons: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  CID,'
      '  CSID,'
      '  CTYPE,'
      '  CAMOUNT,'
      '  CID_CORRECT,'
      '  CDATE,'
      '  CUSERENTER,'
      '  CTIMEENTER,'
      '  CUSEREDIT,'
      '  CTIMEEDIT,'
      '  SCID'
      'from COMMON '
      'where'
      '  CID = :CID')
    ModifySQL.Strings = (
      'update COMMON'
      'set'
      '  CAMOUNT = :CAMOUNT,'
      '  CDATE = :CDATE,'
      '  CID = :CID,'
      '  CID_CORRECT = :CID_CORRECT,'
      '  CSID = :CSID,'
      '  CTYPE = :CTYPE,'
      '  SCID = :SCID'
      'where'
      '  CID = :OLD_CID')
    InsertSQL.Strings = (
      'insert into COMMON'
      '  (CAMOUNT, CDATE, CID, CID_CORRECT, CSID, CTYPE, '
      '    SCID)'
      'values'
      '  (:CAMOUNT, :CDATE, :CID, :CID_CORRECT, :CSID, '
      '   :CTYPE, :SCID)')
    DeleteSQL.Strings = (
      'null;')
    Left = 968
    Top = 313
  end
  object qPeopleMoney: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,' +
        #39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP'
      'FROM PEOPLE P'
      'INNER JOIN USERMONEY UM ON UM.PID = P.PID'
      'WHERE P.PISDELETE IS NULL'
      'ORDER BY 2')
    Left = 1072
    Top = 188
    object qPeopleMoneyPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeopleMoneyPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
  end
  object dsPeopleMoney: TDataSource
    DataSet = qPeopleMoney
    Left = 1040
    Top = 188
  end
  object qPeople1: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      'ORDER BY 3')
    Left = 352
    Top = 157
    object qPeople1PID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeople1PNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeople1PLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeople1PPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeople1PDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeople1PSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeople1PNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeople1PUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeople1PTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeople1PUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeople1PTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeople1PISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeople1PP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeople1SDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPeople1SDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object dsPeople: TDataSource
    DataSet = qPeople1
    Left = 320
    Top = 157
  end
  object qPC: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qPCAfterInsert
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT PC.*'
      'FROM PEOPLE_COMMON PC'
      'WHERE PC.CSID = :CSID')
    UpdateObject = quPC
    Left = 176
    Top = 157
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'CSID'
        ParamType = ptUnknown
      end>
    object qPCPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE_COMMON"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qPCCSID: TIntegerField
      FieldName = 'CSID'
      Origin = '"PEOPLE_COMMON"."CSID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
  end
  object dsPC: TDataSource
    DataSet = qPC
    Left = 144
    Top = 157
  end
  object quPC: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  CSID'
      'from PEOPLE_COMMON '
      'where'
      '  CSID = :CSID and'
      '  PID = :PID')
    ModifySQL.Strings = (
      'update PEOPLE_COMMON'
      'set'
      '  CSID = :CSID,'
      '  PID = :PID'
      'where'
      '  CSID = :OLD_CSID and'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into PEOPLE_COMMON'
      '  (CSID, PID)'
      'values'
      '  (:CSID, :PID)')
    DeleteSQL.Strings = (
      'delete from PEOPLE_COMMON'
      'where'
      '  CSID = :OLD_CSID and'
      '  PID = :OLD_PID')
    Left = 208
    Top = 154
  end
  object qDovLitsa: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'INNER JOIN DOVER_LITSA DL ON DL.PID = P.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      '    AND DL.AGID IN (SELECT APU.AGID'
      '    FROM  AGR_POLUCH_USLUG APU'
      '    WHERE APU.PID = :PID)'
      'ORDER BY 3')
    Left = 384
    Top = 157
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object IntegerField1: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IBStringField1: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object IBStringField2: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object IBStringField3: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object DateField1: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object IntegerField2: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object IBStringField4: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object IBStringField5: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object DateTimeField1: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object IBStringField6: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object DateTimeField2: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object IntegerField3: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object IBStringField7: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object IBStringField8: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IntegerField4: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object qPDov: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      '    AND PS.SDID = 1248'
      'ORDER BY 3')
    Left = 416
    Top = 157
    object IntegerField5: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IBStringField9: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object IBStringField10: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object IBStringField11: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object DateField2: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object IntegerField6: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object IBStringField12: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object IBStringField13: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object DateTimeField3: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object IBStringField14: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object DateTimeField4: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object IntegerField7: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object IBStringField15: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object IBStringField16: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IntegerField8: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object dsPoluchUslug: TDataSource
    Left = 256
    Top = 40
  end
  object qDolgBankPerc: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dsPoluchUslug
    SQL.Strings = (
      
        'SELECT (COALESCE(Znal.zaplnal,0) - COALESCE(ZBB.zaplbb,0) -COALE' +
        'SCE(ZBB.zaplbb/100,0)) AS balance'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN'
      '( '
      'SELECT CS.PID_POLUCH, SUM(COM.CAMOUNT) AS zaplbb '
      'FROM COMMON_SERV CS '
      'INNER JOIN COMMON COM ON COM.CSID = CS.CSID '
      'INNER JOIN SPEC_COND SC ON SC.SCID = COM.SCID '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      
        'WHERE CS.CSISDELETE IS NULL AND SC.SCISDELETE IS NULL AND A.AGIS' +
        'DELETE IS NULL '
      '     AND COM.CTYPE <> 2 '
      '      AND CS.CSFORM = 0 '
      'GROUP BY 1 '
      ') AS ZBB ON ZBB.PID_POLUCH = P.PID'
      'LEFT OUTER JOIN'
      '( '
      'SELECT CS.PID_POLUCH, SUM(COM.CAMOUNT) AS zaplnal'
      'FROM COMMON_SERV CS '
      'INNER JOIN COMMON COM ON COM.CSID = CS.CSID '
      'INNER JOIN SPEC_COND SC ON SC.SCID = COM.SCID '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      
        'WHERE CS.CSISDELETE IS NULL AND SC.SCISDELETE IS NULL AND A.AGIS' +
        'DELETE IS NULL '
      '      AND CS.CSFORM = 0'
      'GROUP BY 1 '
      ') AS Znal ON Znal.PID_POLUCH = P.PID'
      'WHERE P.PID = :PID')
    Left = 944
    Top = 133
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qDolgBankPercBALANCE: TIBBCDField
      FieldName = 'BALANCE'
      ProviderFlags = []
      DisplayFormat = '###,#0'
      Precision = 18
      Size = 2
    end
  end
  object dsDolgBankPerc: TDataSource
    DataSet = qDolgBankPerc
    Left = 904
    Top = 133
  end
  object sqlCopyToTemp: TIBSQL
    Database = DMInv.DBRead
    SQL.Strings = (
      'INSERT INTO COMMON_TEMP'
      'SELECT C.*'
      'FROM COMMON C'
      'WHERE C.CSID = :CSID')
    Transaction = DMInv.IBTransaction1
    Left = 400
    Top = 8
  end
  object sqlDelFromCommon: TIBSQL
    Database = DMInv.DBRead
    SQL.Strings = (
      'DELETE FROM COMMON C'
      'WHERE C.CSID = :CSID')
    Transaction = DMInv.IBTransaction1
    Left = 440
    Top = 8
  end
  object sqlCancelToCommon: TIBSQL
    Database = DMInv.DBRead
    SQL.Strings = (
      'INSERT INTO COMMON'
      'SELECT CT.*'
      'FROM COMMON_TEMP CT'
      'WHERE CT.CSID = :CSID')
    Transaction = DMInv.IBTransaction1
    Left = 480
    Top = 8
  end
  object qOldRaznesenie: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT CT.*'
      'FROM COMMON_TEMP CT'
      'WHERE CT.CSID = :CSID')
    Left = 520
    Top = 8
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'CSID'
        ParamType = ptUnknown
      end>
    object qOldRaznesenieCID: TIntegerField
      FieldName = 'CID'
      Origin = '"COMMON_TEMP"."CID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qOldRaznesenieCSID: TIntegerField
      FieldName = 'CSID'
      Origin = '"COMMON_TEMP"."CSID"'
    end
    object qOldRaznesenieCTYPE: TIntegerField
      FieldName = 'CTYPE'
      Origin = '"COMMON_TEMP"."CTYPE"'
    end
    object qOldRaznesenieCAMOUNT: TIBBCDField
      FieldName = 'CAMOUNT'
      Origin = '"COMMON_TEMP"."CAMOUNT"'
      Precision = 18
      Size = 2
    end
    object qOldRaznesenieCID_CORRECT: TIntegerField
      FieldName = 'CID_CORRECT'
      Origin = '"COMMON_TEMP"."CID_CORRECT"'
    end
    object qOldRaznesenieCDATE: TDateField
      FieldName = 'CDATE'
      Origin = '"COMMON_TEMP"."CDATE"'
    end
    object qOldRaznesenieCUSERENTER: TIBStringField
      FieldName = 'CUSERENTER'
      Origin = '"COMMON_TEMP"."CUSERENTER"'
      Size = 40
    end
    object qOldRaznesenieCTIMEENTER: TDateTimeField
      FieldName = 'CTIMEENTER'
      Origin = '"COMMON_TEMP"."CTIMEENTER"'
    end
    object qOldRaznesenieCUSEREDIT: TIBStringField
      FieldName = 'CUSEREDIT'
      Origin = '"COMMON_TEMP"."CUSEREDIT"'
      Size = 40
    end
    object qOldRaznesenieCTIMEEDIT: TDateTimeField
      FieldName = 'CTIMEEDIT'
      Origin = '"COMMON_TEMP"."CTIMEEDIT"'
    end
    object qOldRaznesenieSCID: TIntegerField
      FieldName = 'SCID'
      Origin = '"COMMON_TEMP"."SCID"'
    end
  end
  object sqlClearCommonTemp: TIBSQL
    Database = DMInv.DBRead
    SQL.Strings = (
      'DELETE FROM COMMON_TEMP CT'
      'WHERE CT.CSID = :CSID')
    Transaction = DMInv.IBTransaction1
    Left = 560
    Top = 8
  end
  object qDolg: TIBSQL
    Database = DMInv.DBRead
    SQL.Strings = (
      'EXECUTE PROCEDURE SP_BALANCE (:PID)')
    Transaction = DMInv.IBTransaction1
    Left = 1056
    Top = 69
  end
  object qServDolgTemp: TIBQuery
    SQL.Strings = (
      'SELECT ST.STNAME, S.SID, SC.SCID,'
      '       SC.SCNUM_N, SC.SCDATEBEGIN, SC.SCDATEEND,'
      
        '       SC.SCTARIFWITHDISCOUNT, ST.STTARIF, (ST.STTARIF - SC.SCTA' +
        'RIFWITHDISCOUNT) AS skidka,'
      '       CASE ST.STTYPE'
      '       WHEN 0 THEN '#39#1056#1072#1079#1086#1074#1072#1103#39
      '       WHEN 1 THEN '#39#1054#1089#1085#1086#1074#1085'.'#39
      '       WHEN 2 THEN '#39#1044#1086#1087#1086#1083#1085#1080#1090'.'#39
      '       END AS tip,'
      '       IIF (ST.STTYPE <> 0,'
      '       CASE ST.STPERIODOPLATY'
      '       WHEN 0 THEN '#39#1052#1077#1089#1103#1094#39
      '       WHEN 1 THEN '#39#1050#1074#1072#1088#1090#1072#1083#39
      '       END, '#39#1053#1077#1090#39') AS period,'
      
        '       CAST(COALESCE(SCPD.dolgny_zapl, 0) AS NUMERIC(18,0)) AS d' +
        'olgny_zapl,'
      
        'CAST ((COALESCE(SCPD.dolgny_zapl, 0) - COALESCE(SCPD1.zapl1,0) -' +
        ' COALESCE(SCPD2.zapl1,0)) AS NUMERIC(18,0))  AS balance,'
      
        'CAST ((COALESCE(SCPD.dolgny_zapl, 0) - COALESCE(SCPD1.zapl1,0) -' +
        ' COALESCE(SCPD2.zapl1,0)) AS NUMERIC(18,0)) AS balance1,'
      
        'CAST('#39'0'#39' AS INTEGER) AS zapl, COALESCE(SCPD1.zapl1,0) AS nal, CO' +
        'ALESCE(SCPD2.zapl1,0) AS beznal,'
      
        '(COALESCE(SCPD1.zapl1,0) + COALESCE(SCPD2.zapl1,0)) AS uje_zapla' +
        'tili'
      'FROM SPEC_COND SC'
      'LEFT OUTER JOIN'
      '('
      'SELECT GP.SCID, SUM(GP.GPAMOUNT) AS dolgny_zapl'
      'FROM SC_GRAFPLAT GP'
      'WHERE GP.GPDATE <= CURRENT_DATE'
      'GROUP BY 1) AS SCPD ON SCPD.SCID = SC.SCID'
      'LEFT OUTER JOIN'
      '('
      'SELECT COM.SCID, SUM(COM.CAMOUNT) AS zapl1'
      'FROM COMMON_SERV CS'
      'INNER JOIN COMMON COM ON COM.CSID = CS.CSID'
      'INNER JOIN SPEC_COND SC ON SC.SCID = COM.SCID '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      
        'WHERE CS.CSISDELETE IS NULL AND SC.SCISDELETE IS NULL AND A.AGIS' +
        'DELETE IS NULL '
      '    AND CS.PID_POLUCH = :PID'
      '    AND CS.CSFORM = 0'
      '    AND COM.CTYPE < 2'
      'GROUP BY 1'
      ') AS SCPD1 ON SCPD1.SCID = SC.SCID'
      'LEFT OUTER JOIN'
      '('
      'SELECT COM.SCID, SUM(COM.CAMOUNT) AS zapl1'
      'FROM COMMON_SERV CS'
      'INNER JOIN COMMON COM ON COM.CSID = CS.CSID'
      'INNER JOIN SPEC_COND SC ON SC.SCID = COM.SCID '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      
        'WHERE CS.CSISDELETE IS NULL AND SC.SCISDELETE IS NULL AND A.AGIS' +
        'DELETE IS NULL '
      '    AND CS.PID_POLUCH = :PID'
      '    AND CS.CSFORM = 1'
      '    AND COM.CTYPE < 2'
      'GROUP BY 1'
      ') AS SCPD2 ON SCPD2.SCID = SC.SCID'
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID'
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID'
      'INNER JOIN SERVICES S ON S.SCID = SC.SCID'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'WHERE SC.SCISDELETE IS NULL'
      '    AND APU.PID = :PID'
      '    AND A.AGISDELETE IS NULL')
    Left = 686
    Top = 224
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
  end
end
